class Teacher:
    school = "tuling" # 类属性
    def __init__(self,name,age,sex): # 对象属性
        self.name = name
        self.age = age
        self.sex = sex

    def course(self): # 方法/函数/技能
        print(self)
        print('course')
        print(self.name)
        print("----------------")
        print("我是龙仔的属性%s"%self.name)
        print("我是龙仔的属性%s"%self.age)
        return "11111"


if __name__ == '__main__':
    # 定义好了的__init__(self,name,age,sex)，三个形参必须传递，不然会报错
    """t1 = Teacher()
    print(t1.__dict__)"""

    # 有__init__方法，有对象独有的属性
    zs = Teacher("张三",18,'男')

    # 对象的独立属性
    print(zs.__dict__) # {"name":"张三","age":18,"sex":"男"}

    # 只是初始化的时候传入了参数,对象还是可以改属性值
    zs.name = "小兰"
    print(zs.__dict__) # {'name': '小兰', 'age': 18, 'sex': '男'}




